<?php
class Bosses extends Zend_Db_Table_Abstract {
	protected $_name = 'bosses';
	protected $_dependentTables = array('RaidKills','BossesItems');
	
	protected $_referenceMap = array(
		'Dungeons'	=> 	array(
						'columns' 		=> array('dungeon_id'),
						'refTableClass' => 'Dungeons',
						'refColumns' 	=> array('id')
						)
		
	);
	
	public static function getById($bossId)
	{	
		// Raid id must be numeric
		if (!is_numeric($bossId)) {
			return null;
		}
		
		// Create static self
		$table = new self();
		
		// Create a select for getting the raid
		$select = $table->select()->where("id = ?", $bossId);
		$boss = $table->fetchRow($select);
		
		// Return the raid or null
		if ($boss) {
			return $boss;
		} else {
			return null;
		}
	}
}
?>